package com.endurance.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

/**
 * @ProjectName: spring-cloud-hoxton-parent
 * @Package: com.endurance.controller
 * @ClassName: CategoriesController
 * @Description:
 * @Author: sunlin
 * @CreateDate: 2024/02/08 10:27
 * @Version: 1.0
 */

@RestController
public class CategoriesController {

    @Value("${server.port}")
    private String port;

    @GetMapping("/categories")
    public String categories(HttpServletRequest request, String red) {
        String header = request.getHeader("X-Request-red");
        System.out.println("header:" + header);
        System.out.println("red:" + red);
        System.out.println("categories ok !!!");
        return "categories ok !!!" + port;
    }

    @GetMapping("/category/categories")
    public String category(HttpServletRequest request, String red) {
        return "category/categories" + port;
    }

}
